<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://xmlns.jcp.org/jsf/passthrough"
      xmlns:ezcomp="http://xmlns.jcp.org/jsf/composite/ezcomp">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{messages.Teacher}#{messages.School}#{messages.Subject}"/>
        </ui:define>
        <ui:define name="body">
            <h:form styleClass="jsfcrud_list_form">
                <h:panelGrid >
                    <ezcomp:majorSchool/>
                    <h:panelGrid columns="2">
                        <h:outputLabel value="#{messages.Please}#{messages.Select}#{messages.A}#{messages.Teacher}"/>
                        <h:selectOneMenu value="#{teacherAdminController.selected}" required="true">
                            <f:selectItem itemLabel="#{messages.Please}#{messages.Select}"/>
                            <f:selectItems value="#{teacherAdminController.teacherList}" var="teacher" itemLabel="#{teacher.secondname}#{teacher.firstname}"/>
                            <f:ajax render="@form"/>
                        </h:selectOneMenu>
                        <h:outputLabel value="#{messages.Please}#{messages.Select}#{messages.A}#{messages.Subject}"/>
                        <h:selectManyListbox value="#{subjectController.selectedSubjectList}" id="subject4School3" required="true">
                            <f:selectItems value="#{subjectController.getSubject4SchoolList()}"/>
                        </h:selectManyListbox>
                        <h:outputLabel value="#{messages.Begin}#{messages.From}"/>
                        <h:inputText value="#{teacschoolsubjectController.selected.fromtime}" p:type="date" title="yyyy-MM-dd" required="true" immediate="true">
                            <f:convertDateTime  pattern="yyyy-MM-dd" />
                        </h:inputText>
                        <h:outputLabel value="#{messages.End}#{messages.Time}"/>
                        <h:inputText value="#{teacschoolsubjectController.selected.totime}" p:type="date" title="yyyy-MM-dd" required="true" immediate="true">
                            <f:convertDateTime  pattern="yyyy-MM-dd" />
                        </h:inputText>
                        <h:commandButton action="#{teacschoolsubjectController.create}" value="#{messages.Save}" />
                    </h:panelGrid>
                </h:panelGrid>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
